home *** CD-ROM | disk | FTP | other *** search
- /*
- NIDirectory.h
- NetInfo Directory Class
- Copyright (c) 1994, NeXT Computer, Inc.
- All rights reserved.
- */
-
- #ifndef STRICT_OPENSTEP
-
- #import <objc/objc.h>
-
- #import <Foundation/NSArray.h>
- #import <Foundation/NSString.h>
- #import <Foundation/NSLock.h>
- #import <Foundation/NSDictionary.h>
- @class NIDomain;
-
- @interface NIDirectory : NSObject
- {
- @private
- NSMutableDictionary *propertyList;
- NSMutableDictionary *readerList;
- NSMutableDictionary *writerList;
- unsigned int directoryNumber;
- unsigned int directoryVersion;
- unsigned int domainVersion;
- NSMutableArray *readers;
- NSMutableArray * writers;
- NIDomain *domain;
- void *handle;
- NSLock *dirLock;
- NIDirectory *parent;
- id reserved;
- }
-
- /*
- * Class Methods
- */
-
- /*
- * Directory access
- */
- + (NIDirectory *)directoryWithPath:(NSString *)path
- inDomain:(NIDomain *)domain;
- + (NIDirectory *)directoryWithNumber:(unsigned)number
- inDomain:(NIDomain *)domain;
-
- /*
- * Synchronize with database
- */
- - (BOOL)isSynchronized;
- - (BOOL)synchronize;
-
- /*
- * Directory information
- */
- - (NIDomain *)domain;
- - (NSString *)name;
- - (NSString *)path;
- - (unsigned int)directoryNumber;
- - (unsigned int)directoryVersion;
- - (unsigned int)domainVersion;
-
- /*
- * Parent and child directories
- */
- - (NIDirectory *)parent;
- - (BOOL)hasSubdirectories;
- - (unsigned)numberOfSubdirectories;
- - (NSArray *)subdirectoryNumbers;
- - (NSArray *)subdirectories;
- - (NSArray *)subdirectoriesWithKey:(NSString *)aKey;
- - (NSArray *)subdirectoriesWithKey:(NSString *)aKey value:(NSString *)aVal;
-
- /*
- * Subdirectory keys and values
- */
- - (NIDirectory *)subdirectoryWithName:(NSString *)name;
- - (NSArray *)subdirectoryKeys;
- - (NSArray *)subdirectoryValuesForKey:(NSString *)aKey;
-
- /*
- * Add and remove directories.
- */
- - (BOOL)destroy;
- - (BOOL)attach:(NIDirectory *)aDir;
- - (BOOL)attachByCopy:(NIDirectory *)aDir
- recursive:(BOOL)flag;
- - (BOOL)detach:(NIDirectory *)aDir;
- - (BOOL)createSubdirectory:(NSString *)name;
- - (BOOL)createPath:(NSString *)path;
-
- /*
- * PropertyList access.
- */
- - (BOOL)replacePropertyList:(NSDictionary *)aDict;
- - (NSDictionary *)propertyList;
-
- /*
- * PropertyList convenience methods.
- */
- - (NSArray *)allKeys;
- - (NSArray *)valuesForKey:(NSString *)aKey;
- - (NSString *)firstValueForKey:(NSString *)aKey;
- - (BOOL)hasValue:(NSString *)aVal forKey:(NSString *)aKey;
-
- - (BOOL)replaceValues:(NSArray *)aVal forKey:(NSString *)aKey;
- - (BOOL)appendValue:(NSString *)aVal forKey:(NSString *)aKey;
- - (BOOL)insertValue:(NSString *)aVal
- forKey:(NSString *)aKey
- atIndex:(unsigned)where;
-
- - (BOOL)removeValue:(NSString *)aVal forKey:(NSString *)aKey;
- - (BOOL)removeValueAtIndex:(unsigned)where forKey:(NSString *)aKey;
- - (BOOL)removeKey:(NSString *)aKey;
-
- /*
- * Access control lists.
- * Note that read access control has not yet been implemented in the server.
- */
- - (NSArray *)readers;
- - (NSArray *)writers;
-
- - (NSArray *)readersForKey:(NSString *)aKey;
- - (NSArray *)writersForKey:(NSString *)aKey;
-
- - (BOOL)addReader:(NSString *)userName;
- - (BOOL)addWriter:(NSString *)userName;
-
- - (BOOL)addReader:(NSString *)userName forKey:(NSString *)aKey;
- - (BOOL)addWriter:(NSString *)userName forKey:(NSString *)aKey;
-
- - (BOOL)removeReader:(NSString *)userName;
- - (BOOL)removeWriter:(NSString *)userName;
-
- - (BOOL)removeReader:(NSString *)userName forKey:(NSString *)aKey;
- - (BOOL)removeWriter:(NSString *)userName forKey:(NSString *)aKey;
-
- @end
-
- #endif STRICT_OPENSTEP
-